/**
 * 
 * @author Sunix
 * @date   2013-5-17
 * @Email  SunixSky@gmail.com
 * 
 * 基础动画制作面板
 */	
package view.components{
	import com.greensock.TweenLite;
	import com.greensock.easing.Linear;
	
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.events.Event;
	
	import manager.LoggerManager;
	
	public class BaseAnimationCreatePanel extends Sprite{
			
		public var logWindow:LogWindow;     //日志窗口
		public var animationWindow:AnimationWindow;     //日志窗口

		public function BaseAnimationCreatePanel(){
			addEventListener(Event.ADDED_TO_STAGE,onAddedToStage);
			addEventListener(Event.REMOVED_FROM_STAGE,onRemoveFromStage);
		}
		
		protected function onRemoveFromStage(event:Event):void{
		
			
		}
		
		public function switchDisplay(show:DisplayObject,hide:DisplayObject):void{
			show.alpha = 0;
			addChild(show);
			var array:Array = new Array(hide);
			TweenLite.to(hide,1,{alpha:0,ease:Linear.easeNone,onComplete:destory,onCompleteParams:array});
			TweenLite.to(show,1,{alpha:1,ease:Linear.easeNone,delay:1});
		}
		
		public function destory(panel:DisplayObject):void{
			removeChild(panel);
		}
		
		protected function onAddedToStage(event:Event):void{
			LoggerManager.init(logWindow);
			LoggerManager.log("编辑器初始化完毕");
		}
	}
}